/**
 * Created by fangshufeng on 2018/3/25.
 */

function productReduce(state = {name:'默认',isLogin:false}, action) {
    switch (action.type) {
        case 'PRODUCT_ADD':
            return  { ...state, name:action.data};
        case 'PRODUCT_ADD2':
            return { ...state, name:'第二种方式'};
        case 'PRODUCT_ADD3':
            return  { ...state, name:action.data.name};
        case 'PRODUCT_Login':
            return  { ...state, isLogin:true};
        case 'PRODUCT_Logout':
            return  { ...state, isLogin:false};
        default:
            return state;
    }
}

export default productReduce;